import { FormItemController } from '@ibiz-template/runtime';
import { useNamespace } from '@ibiz-template/vue3-util';
import { IDEFormDetail } from '@ibiz/model-core';
import { defineComponent, PropType } from 'vue';
import './form-user-control.scss';

export const IBizFormUserControl = defineComponent({
  name: 'IBizFormUserControl',
  props: {
    modelData: {
      type: Object as PropType<IDEFormDetail>,
      required: true,
    },
    controller: {
      type: FormItemController,
      required: true,
    },
  },
  setup() {
    const ns = useNamespace('form-user-control');

    return { ns };
  },
  render() {
    return (
      <div
        class={[
          this.ns.b(),
          this.ns.m(this.modelData.codeName),
          ...this.controller.containerClass,
        ]}
      >
        这是一个表单成员插件
      </div>
    );
  },
});
export default IBizFormUserControl;
